import request from '@/utils/request'

// 策略管理table渲染  搜索
export function getTacticsRequest (params) {
  return request({
    url: '/vm-service/policy/search',
    method: 'get',
    params
  })
}

// 删除
export function delTacticsRequest (id) {
  return request({
    url: `/vm-service/policy/${id}`,
    method: 'delete'
  })
}

// 添加策略
export function addTacticsRequest (data) {
  return request({
    url: '/vm-service/policy',
    method: 'post',
    data
  })
}

// 查看详情
export function getTacticsDetailRequest (id) {
  return request({
    url: `/vm-service/policy/vmList/${id}`,
    method: 'get'
  })
}

// 数据回显
export function checkTacticsDetailRequest (id) {
  return request({
    url: `/vm-service/policy/${id}`,
    method: 'get'
  })
}

// 修改数据
export function editTacticsDetailRequest (id, data) {
  return request({
    url: `/vm-service/policy/${id}`,
    method: 'put',
    data
  })
}
